home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 138 / pascal / min.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-05-13  |  588 b   |  48 lines

  1. {
  2.  
  3.      Function Min_int accepts two integers as arguments and returns
  4.      the lesser of the two.
  5.  
  6. }
  7.  
  8. function
  9. MIN_INT(
  10.             x,
  11.             y   : integer
  12.        ): integer;
  13.  
  14.  
  15. BEGIN {MIN_INT}
  16.  
  17. If x < y then
  18.    Min_Int := x
  19. Else
  20.    Min_Int := y
  21.  
  22. END; {MIN_INT}
  23.  
  24.  
  25.  
  26. {
  27.  
  28.    Function Min_Real accepts two real numbers as arguments and
  29.    returns the lesser of the two.
  30.  
  31. }
  32.  
  33. function
  34. MIN_REAL(
  35.              x,
  36.              y    : real
  37.         ): real;
  38.  
  39.  
  40. BEGIN {MIN_REAL}
  41.  
  42. If x < y then
  43.    Min_Real := x
  44. Else
  45.    Min_Real := y
  46.  
  47. END; {MIN_REAL}
  48.